<?php
$sql="
CREATE TABLE IF NOT EXISTS `ims_bh_bg_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `name` varchar(30) NOT NULL,
  `phone` varchar(30) NOT NULL,
  `address` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_advertisement` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `image` varchar(255) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `position` tinyint(4) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `group_id` varchar(100) NOT NULL,
  `appid` varchar(50) NOT NULL,
  `url` varchar(255) NOT NULL,
  `sort` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `sort` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(50) NOT NULL,
  `value` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `key` (`key`,`uniacid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=144 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_coupon` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `name` varchar(255) NOT NULL,
  `icon` varchar(255) NOT NULL,
  `integral` int(11) NOT NULL DEFAULT '0',
  `worth` int(11) NOT NULL DEFAULT '0',
  `validity` int(11) NOT NULL DEFAULT '1',
  `is_delete` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_id` int(11) NOT NULL DEFAULT '0',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `integral` int(11) NOT NULL DEFAULT '0',
  `is_first` tinyint(4) NOT NULL DEFAULT '1',
  `share_txt` varchar(255) NOT NULL,
  `cover_image` varchar(255) NOT NULL DEFAULT '',
  `images` text NOT NULL,
  `name` varchar(255) NOT NULL DEFAULT '',
  `stock` int(11) NOT NULL DEFAULT '0',
  `is_free` tinyint(4) NOT NULL DEFAULT '1',
  `free` decimal(10,2) NOT NULL DEFAULT '0.00',
  `details` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `is_delete` tinyint(4) NOT NULL DEFAULT '1',
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `sort` int(11) NOT NULL,
  `in_after` int(4) NOT NULL DEFAULT '0',
  `old_start` decimal(10,2) NOT NULL DEFAULT '0.00',
  `old_end` decimal(10,2) NOT NULL DEFAULT '0.00',
  `new_start` decimal(10,2) NOT NULL DEFAULT '0.00',
  `new_end` decimal(10,2) NOT NULL DEFAULT '0.00',
  `old_after_start` decimal(10,2) NOT NULL DEFAULT '0.00',
  `old_after_end` decimal(10,2) NOT NULL DEFAULT '0.00',
  `new_after_start` decimal(10,2) NOT NULL DEFAULT '0.00',
  `new_after_end` decimal(10,2) NOT NULL DEFAULT '0.00',
  `own_start` decimal(10,2) NOT NULL DEFAULT '0.00',
  `own_end` decimal(10,2) NOT NULL DEFAULT '0.00',
  `bargain_time` int(11) NOT NULL DEFAULT '0',
  `bargain_number` int(11) NOT NULL DEFAULT '0',
  `is_home` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `category_id` (`category_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_integral_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `sort` int(11) NOT NULL,
  `describe` varchar(255) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_integral_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_id` int(11) NOT NULL,
  `relation_goods_id` varchar(50) NOT NULL DEFAULT '',
  `type` int(11) NOT NULL DEFAULT '1',
  `red_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `original_price` decimal(10,2) NOT NULL,
  `goods_name` varchar(255) NOT NULL,
  `share_title` varchar(300) NOT NULL,
  `exchange_type` tinyint(4) NOT NULL DEFAULT '1',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `exchange_number` int(11) NOT NULL,
  `cover_image` varchar(255) NOT NULL,
  `image` text NOT NULL,
  `is_free` tinyint(4) NOT NULL DEFAULT '1',
  `free` decimal(10,2) NOT NULL,
  `inventory_type` tinyint(4) NOT NULL,
  `inventory` int(11) NOT NULL DEFAULT '0',
  `introduce` text NOT NULL,
  `allow_number` int(11) NOT NULL DEFAULT '0',
  `uniacid` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '1',
  `sigin` int(11) NOT NULL DEFAULT '0',
  `is_delete` tinyint(4) NOT NULL DEFAULT '1',
  `is_home` tinyint(4) NOT NULL DEFAULT '1',
  `sort` int(11) NOT NULL DEFAULT '0',
  `exchange_num` int(11) NOT NULL DEFAULT '0',
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `category_id` (`category_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_integral_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `integral` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `same_day` int(11) NOT NULL,
  `after_integral` int(11) NOT NULL DEFAULT '0',
  `remarks` varchar(1000) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_integral_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `goods_id` int(11) NOT NULL,
  `relation_goods_id` varchar(255) NOT NULL DEFAULT '',
  `member_id` int(11) NOT NULL,
  `exchange_type` tinyint(11) NOT NULL DEFAULT '1',
  `exchange_number` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `free` decimal(10,2) NOT NULL DEFAULT '0.00',
  `courier_name` varchar(255) NOT NULL,
  `courier_number` varchar(100) NOT NULL,
  `address` varchar(1000) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `delivery_time` int(11) NOT NULL,
  `complete_time` int(11) NOT NULL,
  `fictitious` varchar(255) NOT NULL,
  `name` varchar(50) NOT NULL,
  `phone` varchar(50) NOT NULL,
  `is_under_line` tinyint(4) NOT NULL DEFAULT '1',
  `is_pay` tinyint(4) NOT NULL DEFAULT '1',
  `is_fictitious` tinyint(4) NOT NULL DEFAULT '1',
  `created` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE,
  KEY `goods_id` (`goods_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `is_senior` tinyint(4) NOT NULL DEFAULT '1',
  `senior_source` tinyint(4) NOT NULL DEFAULT '1',
  `lottery_type` tinyint(4) NOT NULL DEFAULT '1',
  `lottery_value` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `is_delete` tinyint(4) NOT NULL DEFAULT '1',
  `member_id` int(11) NOT NULL,
  `sponsor` varchar(100) NOT NULL,
  `sponsor_type` tinyint(4) NOT NULL DEFAULT '1',
  `sponsor_text` varchar(2000) NOT NULL,
  `lottery_explain` varchar(2000) NOT NULL,
  `image_text` text NOT NULL,
  `luck_mode` tinyint(4) NOT NULL DEFAULT '1',
  `luck_pwd` varchar(500) NOT NULL,
  `team_number` int(11) NOT NULL,
  `lottery_time` int(11) NOT NULL,
  `goods` text NOT NULL,
  `prize_number` int(11) NOT NULL,
  `is_ad` tinyint(4) NOT NULL DEFAULT '1',
  `integral` int(11) NOT NULL DEFAULT '0',
  `complete` tinyint(4) NOT NULL DEFAULT '1',
  `send_msg` tinyint(4) NOT NULL DEFAULT '1',
  `exposure_number` int(11) NOT NULL DEFAULT '0',
  `examine` tinyint(4) NOT NULL DEFAULT '2',
  `appoint_group` tinyint(4) NOT NULL DEFAULT '1',
  `group_id` varchar(65) NOT NULL COMMENT '指定群id',
  `loop` tinyint(4) NOT NULL DEFAULT '1',
  `is_share` tinyint(4) NOT NULL DEFAULT '1',
  `receive_type` tinyint(4) NOT NULL DEFAULT '1',
  `receive_url` varchar(255) NOT NULL,
  `automatic` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `luck_id` int(11) NOT NULL DEFAULT '0',
  `member_id` int(11) NOT NULL,
  `invitation_member_id` int(11) NOT NULL DEFAULT '0',
  `in_prize` tinyint(4) NOT NULL DEFAULT '1',
  `is_appoint` tinyint(4) NOT NULL DEFAULT '1',
  `goods_info_id` int(11) NOT NULL DEFAULT '0',
  `appoint_goods_id` int(11) NOT NULL,
  `code` char(10) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `luck_id` (`luck_id`) USING BTREE,
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `luck_id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `red_type` tinyint(4) NOT NULL DEFAULT '1',
  `red_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `name` varchar(255) NOT NULL,
  `image` varchar(255) NOT NULL,
  `number` int(11) NOT NULL,
  `fictitious` text NOT NULL,
  `source` tinyint(4) NOT NULL DEFAULT '1',
  `goods_id` int(11) NOT NULL DEFAULT '0',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `luck_id` (`luck_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck_goods_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `luck_id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `in_member_id` int(11) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `name` varchar(255) NOT NULL,
  `money` decimal(10,2) NOT NULL,
  `image` varchar(255) NOT NULL,
  `fictitious` text NOT NULL,
  `source` tinyint(4) NOT NULL DEFAULT '1',
  `luck_goods_id` int(11) NOT NULL,
  `goods_id` int(11) NOT NULL,
  `is_appoint` tinyint(4) NOT NULL DEFAULT '1',
  `appoint_id` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `courier_name` varchar(255) NOT NULL,
  `courier_number` varchar(100) NOT NULL,
  `complete_time` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `luck_id` (`luck_id`) USING BTREE,
  KEY `luck_goods_id` (`luck_goods_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `luck_id` int(11) NOT NULL,
  `max_number` int(11) NOT NULL DEFAULT '3',
  `current_number` int(11) NOT NULL,
  `luck_goods_id` int(11) NOT NULL,
  `is_appoint` tinyint(4) NOT NULL DEFAULT '1',
  `appoint_goods_id` int(11) NOT NULL DEFAULT '0',
  `in_prize` int(11) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `luck_id` (`luck_id`) USING BTREE,
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck_group_member` (
  `id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `l_member_id` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`) USING BTREE,
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_luck_participate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `luck_id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL DEFAULT '0',
  `in_prize` tinyint(4) NOT NULL DEFAULT '1',
  `goods_info_id` int(11) NOT NULL DEFAULT '0',
  `participate_group_id` int(11) NOT NULL DEFAULT '0',
  `backstage` tinyint(4) NOT NULL DEFAULT '1',
  `msg_status` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `lm` (`luck_id`,`member_id`),
  KEY `luck_id` (`luck_id`) USING BTREE,
  KEY `member_id` (`member_id`) USING BTREE,
  KEY `group_id` (`group_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_member` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `unionid` int(11) NOT NULL,
  `uniacid` int(11) unsigned NOT NULL DEFAULT '0',
  `openid` varchar(50) NOT NULL DEFAULT '',
  `nickname` varchar(60) NOT NULL DEFAULT '' COMMENT '用户昵称',
  `headimgurl` varchar(200) NOT NULL DEFAULT '' COMMENT '用户头像',
  `sex` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '用户性别',
  `country` varchar(128) NOT NULL COMMENT '国家',
  `province` varchar(128) NOT NULL COMMENT '省份',
  `city` varchar(128) NOT NULL COMMENT '城市',
  `parent_id` int(11) NOT NULL DEFAULT '0',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `integral` int(11) NOT NULL DEFAULT '0',
  `phone` char(11) NOT NULL,
  `payment_code` varchar(255) NOT NULL,
  `cash` int(255) NOT NULL,
  `is_fictitious` tinyint(4) NOT NULL DEFAULT '1',
  `created` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `openid` (`openid`,`uniacid`) USING BTREE,
  KEY `parent_id` (`parent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_member_coupon` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `coupon_id` int(11) NOT NULL,
  `is_use` tinyint(4) NOT NULL DEFAULT '1',
  `use_time` int(11) NOT NULL DEFAULT '0',
  `order_id` int(11) NOT NULL DEFAULT '0',
  `expire` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_member_red_bag` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `red_bag_id` int(11) NOT NULL,
  `same_day` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `mr` (`member_id`,`red_bag_id`) USING BTREE,
  KEY `red_bag_id` (`red_bag_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_money_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `money` decimal(10,2) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `after_money` decimal(10,2) NOT NULL,
  `remarks` varchar(255) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_multiple` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) NOT NULL,
  `secret` varchar(255) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `uniacid` (`uniacid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_navigation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `position` varchar(50) NOT NULL,
  `path` varchar(255) NOT NULL,
  `selection_image` varchar(255) NOT NULL,
  `unchecked_images` varchar(255) NOT NULL,
  `selection_color` varchar(20) NOT NULL,
  `unchecked_color` varchar(20) NOT NULL,
  `sort` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `position` (`position`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL DEFAULT '0',
  `goods_id` int(11) NOT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `integral` int(11) NOT NULL DEFAULT '0',
  `bargain` decimal(10,2) NOT NULL DEFAULT '0.00',
  `time_start` int(11) NOT NULL DEFAULT '0',
  `time_end` int(11) NOT NULL DEFAULT '0',
  `suc_time` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `is_pay` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `deliver_status` tinyint(4) NOT NULL DEFAULT '1',
  `courier_name` varchar(255) NOT NULL DEFAULT '',
  `courier_number` varchar(50) NOT NULL DEFAULT '',
  `address` varchar(255) NOT NULL DEFAULT '',
  `delivery_time` int(11) NOT NULL DEFAULT '0',
  `complete_time` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `phone` char(11) NOT NULL DEFAULT '',
  `coupon_id` int(11) NOT NULL DEFAULT '0',
  `is_fictitious` tinyint(4) NOT NULL DEFAULT '1',
  `noticeTime` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE,
  KEY `goods_id` (`goods_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_order_bargain` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL DEFAULT '0',
  `goods_id` int(11) NOT NULL DEFAULT '0',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `ip` varchar(50) NOT NULL,
  `equipment` varchar(1000) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE,
  KEY `order_id` (`order_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_pay_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `trade_no` char(50) NOT NULL,
  `transaction_id` char(32) NOT NULL,
  `pay_time` int(11) NOT NULL,
  `money` decimal(10,2) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `relation_id` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_red_bag` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `describe` varchar(100) NOT NULL DEFAULT '',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `integral` int(11) NOT NULL DEFAULT '0',
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `start` decimal(10,2) NOT NULL DEFAULT '0.00',
  `end` decimal(10,2) NOT NULL DEFAULT '0.00',
  `sign_days` int(11) NOT NULL DEFAULT '0',
  `number` int(11) NOT NULL,
  `receive` int(11) NOT NULL DEFAULT '1',
  `sort` int(11) NOT NULL DEFAULT '0',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_remind` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `remind_time` int(11) NOT NULL,
  `remind_day` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_roll` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `image` varchar(255) NOT NULL,
  `content` varchar(255) DEFAULT NULL,
  `uniacid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_rule` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `position` tinyint(4) NOT NULL DEFAULT '1',
  `sort` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_signin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `all_sigin` int(11) NOT NULL,
  `days` int(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `updated` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_subscribe` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `new_activities` int(11) NOT NULL DEFAULT '0' COMMENT '新活动消息可发送次数',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订阅消息发送次数';


CREATE TABLE IF NOT EXISTS `ims_bh_bg_subscribe_queue` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subscribe_id` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1:发送中,2:发送完成,3:停止',
  `number` int(11) NOT NULL DEFAULT '0' COMMENT '发生数量',
  `uniacid` int(11) NOT NULL,
  `content` text NOT NULL COMMENT '发送内容',
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `number` int(11) NOT NULL DEFAULT '1',
  `title` varchar(255) NOT NULL,
  `integral` int(11) NOT NULL DEFAULT '0',
  `appid` varchar(20) NOT NULL,
  `path` varchar(255) NOT NULL,
  `sort` int(11) NOT NULL,
  `position` tinyint(4) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_task_member` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `number` int(11) NOT NULL DEFAULT '1',
  `uniacid` int(11) NOT NULL,
  `same_day` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `mt` (`member_id`,`task_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_token` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `token` char(32) NOT NULL,
  `member_id` int(11) NOT NULL,
  `session_key` varchar(255) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `token` (`token`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_withdrawals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `money` decimal(10,2) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `success_time` int(11) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `payment_code` varchar(150) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `ims_bh_bg_withdrawals_condition` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `number` int(11) NOT NULL DEFAULT '1',
  `click_day` int(11) NOT NULL DEFAULT '1',
  `share_num` int(11) NOT NULL DEFAULT '0',
  `money` decimal(10,2) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `number` (`number`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

";
pdo_run($sql);
if(!pdo_fieldexists("bh_bg_address", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_address", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_address", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `name` varchar(30) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_address", "phone")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `phone` varchar(30) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_address", "address")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `address` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_address", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_address", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_address")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "title")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `title` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `image` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "position")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `position` tinyint(4) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_advertisement", "group_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `group_id` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "appid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `appid` varchar(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "url")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `url` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_advertisement", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_advertisement")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_category", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_category")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_category", "title")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_category")." ADD `title` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_category", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_category")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_category", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_category")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_category", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_category")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_config", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_config")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_config", "key")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_config")." ADD `key` varchar(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_config", "value")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_config")." ADD `value` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_config", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_config")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_coupon", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_coupon", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_coupon", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_coupon", "icon")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `icon` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_coupon", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_coupon", "worth")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `worth` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_coupon", "validity")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `validity` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_coupon", "is_delete")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `is_delete` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_coupon", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_coupon", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_coupon")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_goods", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_goods", "category_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `category_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_goods", "price")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `price` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_goods", "is_first")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `is_first` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_goods", "share_txt")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `share_txt` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_goods", "cover_image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `cover_image` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_goods", "images")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `images` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_goods", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `name` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_goods", "stock")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `stock` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_goods", "is_free")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `is_free` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_goods", "free")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `free` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "details")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `details` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_goods", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_goods", "is_delete")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `is_delete` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_goods", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_goods", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_goods", "in_after")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `in_after` int(4) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_goods", "old_start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `old_start` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "old_end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `old_end` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "new_start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `new_start` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "new_end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `new_end` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "old_after_start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `old_after_start` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "old_after_end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `old_after_end` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "new_after_start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `new_after_start` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "new_after_end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `new_after_end` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "own_start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `own_start` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "own_end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `own_end` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_goods", "bargain_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `bargain_time` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_goods", "bargain_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `bargain_number` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_goods", "is_home")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_goods")." ADD `is_home` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_group", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_group")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_group", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_group")." ADD `name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_group", "code")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_group")." ADD `code` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_group", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_group")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_group", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_group")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_category", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_category")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_integral_category", "title")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_category")." ADD `title` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_integral_category", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_category")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_category", "describe")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_category")." ADD `describe` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_category", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_category")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_category", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_category")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "category_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `category_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "relation_goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `relation_goods_id` varchar(50) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `type` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "red_money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `red_money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "original_price")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `original_price` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "goods_name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `goods_name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "share_title")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `share_title` varchar(300) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "exchange_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `exchange_type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "exchange_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `exchange_number` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "cover_image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `cover_image` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `image` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "is_free")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `is_free` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "free")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `free` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "inventory_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `inventory_type` tinyint(4) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "inventory")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `inventory` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "introduce")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `introduce` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "allow_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `allow_number` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `status` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "sigin")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `sigin` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "is_delete")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `is_delete` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "is_home")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `is_home` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `sort` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "exchange_num")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `exchange_num` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_goods", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_goods")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `integral` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_log", "same_day")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `same_day` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "after_integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `after_integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_log", "remarks")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `remarks` varchar(1000) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_log", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_log")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `goods_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "relation_goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `relation_goods_id` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "exchange_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `exchange_type` tinyint(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "exchange_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `exchange_number` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "free")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `free` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "courier_name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `courier_name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "courier_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `courier_number` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "address")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `address` varchar(1000) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "delivery_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `delivery_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "complete_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `complete_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "fictitious")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `fictitious` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `name` varchar(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "phone")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `phone` varchar(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_integral_order", "is_under_line")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `is_under_line` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "is_pay")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `is_pay` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "is_fictitious")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `is_fictitious` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_integral_order", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_integral_order")." ADD `created` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_luck", "is_senior")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `is_senior` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "senior_source")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `senior_source` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "lottery_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `lottery_type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "lottery_value")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `lottery_value` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "is_delete")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `is_delete` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "sponsor")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `sponsor` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "sponsor_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `sponsor_type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "sponsor_text")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `sponsor_text` varchar(2000) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "lottery_explain")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `lottery_explain` varchar(2000) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "image_text")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `image_text` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "luck_mode")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `luck_mode` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "luck_pwd")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `luck_pwd` varchar(500) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "team_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `team_number` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "lottery_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `lottery_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "goods")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `goods` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "prize_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `prize_number` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "is_ad")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `is_ad` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck", "complete")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `complete` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "send_msg")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `send_msg` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "exposure_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `exposure_number` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck", "examine")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `examine` tinyint(4) NOT NULL DEFAULT '2';");
}
if(!pdo_fieldexists("bh_bg_luck", "appoint_group")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `appoint_group` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "group_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `group_id` varchar(65) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "loop")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `loop` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "is_share")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `is_share` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "receive_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `receive_type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "receive_url")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `receive_url` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "automatic")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `automatic` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck")." ADD `created` int(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_code", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_luck_code", "luck_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `luck_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_code", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_code", "invitation_member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `invitation_member_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_code", "in_prize")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `in_prize` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_code", "is_appoint")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `is_appoint` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_code", "goods_info_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `goods_info_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_code", "appoint_goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `appoint_goods_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_code", "code")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `code` char(10) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_code", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_code", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_code", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_code")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "luck_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `luck_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "red_type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `red_type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "red_money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `red_money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `image` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `number` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "fictitious")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `fictitious` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "source")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `source` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `goods_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "luck_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `luck_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "in_member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `in_member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `money` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `image` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "fictitious")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `fictitious` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "source")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `source` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "luck_goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `luck_goods_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `goods_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "is_appoint")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `is_appoint` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "appoint_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `appoint_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "courier_name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `courier_name` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "courier_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `courier_number` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "complete_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `complete_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_goods_info", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_goods_info")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "luck_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `luck_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "max_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `max_number` int(11) NOT NULL DEFAULT '3';");
}
if(!pdo_fieldexists("bh_bg_luck_group", "current_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `current_number` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "luck_goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `luck_goods_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "is_appoint")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `is_appoint` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_group", "appoint_goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `appoint_goods_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_group", "in_prize")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `in_prize` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_group", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group_member", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group_member")." ADD `id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group_member", "group_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group_member")." ADD `group_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group_member", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group_member")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group_member", "l_member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group_member")." ADD `l_member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group_member", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group_member")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_group_member", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_group_member")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "luck_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `luck_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "group_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `group_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "in_prize")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `in_prize` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "goods_info_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `goods_info_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "participate_group_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `participate_group_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "backstage")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `backstage` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "msg_status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `msg_status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_luck_participate", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_luck_participate")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `id` int(11) unsigned NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_member", "unionid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `unionid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `uniacid` int(11) unsigned NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member", "openid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `openid` varchar(50) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_member", "nickname")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `nickname` varchar(60) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_member", "headimgurl")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `headimgurl` varchar(200) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_member", "sex")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `sex` tinyint(3) unsigned NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member", "country")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `country` varchar(128) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "province")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `province` varchar(128) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "city")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `city` varchar(128) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "parent_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `parent_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_member", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member", "phone")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `phone` char(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "payment_code")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `payment_code` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "cash")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `cash` int(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member", "is_fictitious")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `is_fictitious` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_member", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member")." ADD `created` int(11) unsigned NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "coupon_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `coupon_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "is_use")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `is_use` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "use_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `use_time` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "order_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `order_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "expire")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `expire` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_coupon", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_coupon")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "red_bag_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `red_bag_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "same_day")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `same_day` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_member_red_bag", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_member_red_bag")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_money_log", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_money_log", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_money_log", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `money` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_money_log", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_money_log", "after_money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `after_money` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_money_log", "remarks")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `remarks` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_money_log", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_money_log", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_money_log")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_multiple", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_multiple")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_multiple", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_multiple")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_multiple", "secret")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_multiple")." ADD `secret` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_multiple", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_multiple")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_navigation", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `name` varchar(20) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "position")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `position` varchar(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "path")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `path` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "selection_image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `selection_image` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "unchecked_images")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `unchecked_images` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "selection_color")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `selection_color` varchar(20) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "unchecked_color")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `unchecked_color` varchar(20) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_navigation", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_navigation")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_order", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `member_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `goods_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order", "price")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `price` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_order", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "bargain")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `bargain` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_order", "time_start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `time_start` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "time_end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `time_end` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "suc_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `suc_time` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_order", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_order", "is_pay")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `is_pay` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_order", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order", "deliver_status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `deliver_status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_order", "courier_name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `courier_name` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_order", "courier_number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `courier_number` varchar(50) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_order", "address")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `address` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_order", "delivery_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `delivery_time` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "complete_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `complete_time` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "name")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `name` varchar(255) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_order", "phone")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `phone` char(11) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_order", "coupon_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `coupon_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order", "is_fictitious")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `is_fictitious` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_order", "noticeTime")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order")." ADD `noticeTime` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "order_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `order_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "goods_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `goods_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "ip")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `ip` varchar(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "equipment")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `equipment` varchar(1000) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_order_bargain", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_order_bargain")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "trade_no")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `trade_no` char(50) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "transaction_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `transaction_id` char(32) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "pay_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `pay_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `money` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_pay_order", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_pay_order", "relation_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `relation_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_pay_order", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_pay_order")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_red_bag", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_red_bag", "describe")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `describe` varchar(100) NOT NULL DEFAULT '';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `money` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "start")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `start` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "end")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `end` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "sign_days")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `sign_days` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `number` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_red_bag", "receive")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `receive` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `sort` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_red_bag", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_red_bag", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_red_bag")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_remind", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_remind", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_remind", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_remind", "remind_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `remind_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_remind", "remind_day")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `remind_day` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_remind", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `type` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_remind", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_remind", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_remind")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_roll", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_roll")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_roll", "image")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_roll")." ADD `image` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_roll", "content")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_roll")." ADD `content` varchar(255);");
}
if(!pdo_fieldexists("bh_bg_roll", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_roll")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_rule", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_rule", "title")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `title` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_rule", "content")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `content` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_rule", "position")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `position` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_rule", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_rule", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_rule", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_rule")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_signin", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_signin", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_signin", "all_sigin")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `all_sigin` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_signin", "days")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `days` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_signin", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_signin", "updated")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `updated` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_signin", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_signin")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_subscribe", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_subscribe", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_subscribe", "new_activities")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe")." ADD `new_activities` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_subscribe", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_subscribe", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "subscribe_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `subscribe_id` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `number` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "content")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `content` text NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_subscribe_queue", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_subscribe_queue")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_task", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_task", "number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `number` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_task", "title")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `title` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task", "integral")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `integral` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_task", "appid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `appid` varchar(20) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task", "path")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `path` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task", "sort")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `sort` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task", "position")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `position` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_task", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task_member", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_task_member", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task_member", "task_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `task_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task_member", "number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `number` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_task_member", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task_member", "same_day")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `same_day` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_task_member", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_task_member")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_token", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_token")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_token", "token")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_token")." ADD `token` char(32) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_token", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_token")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_token", "session_key")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_token")." ADD `session_key` varchar(255) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_token", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_token")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_token", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_token")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "member_id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `member_id` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `money` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "status")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `status` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "success_time")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `success_time` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "type")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `type` tinyint(4) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "payment_code")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `payment_code` varchar(150) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals")." ADD `created` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "id")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `id` int(11) NOT NULL AUTO_INCREMENT;");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "number")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `number` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "click_day")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `click_day` int(11) NOT NULL DEFAULT '1';");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "share_num")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `share_num` int(11) NOT NULL DEFAULT '0';");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "money")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `money` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "uniacid")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists("bh_bg_withdrawals_condition", "created")) {
 pdo_query("ALTER TABLE ".tablename("bh_bg_withdrawals_condition")." ADD `created` int(11) NOT NULL;");
}
